package com.ysdcrm.crm.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ysdcrm.crm.model.Roles;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface IRolesMapper extends BaseMapper<Roles>{
    @Select("select count(name) from roles where name = #{name}")
    int getNameCount(String name);

    @Update("update roles set status = 0 where rid = #{rid}")
    int del(int rid);

    @Select("select r.* from roles r join user_role_relation u on r.rid = u.rid where u.uid = #{uid}")
    Roles findByUid(int uid);//根据uid查询角色
}
